<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="keys" content="">
    <meta name="author" content="">
	<link rel="stylesheet" href="../bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="../css/font-awesome.min.css">
	<link rel="stylesheet" href="../css/login.css">
	<style>

	</style>
  </head>
  <body>
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <div><a class="navbar-brand" href="index.html" style="font-size:32px;">众筹网-创意产品众筹平台</a></div>
        </div>
      </div>
    </nav>

    <div class="container">

      <form id="userFrom" class="form-signin" action="/reg.do"  method="post">

        <h2 class="form-signin-heading"><i class="glyphicon glyphicon-log-in"></i> 找回密码</h2>
		  <div class="form-group has-success has-feedback">
			<input type="text" name="loginacct" onblur="regSelect()" class="form-control" id="loginacct" placeholder="请输入要找回的账号" autofocus>
			<span class="glyphicon glyphicon-user form-control-feedback"></span>
		  </div>


        <div class="checkbox">
          <label style="float:left">
            <a href="login.html">返回登录</a>
          </label>
            <label style="float:right">
                <a href="reg.html">我要注册</a>
            </label>
        </div><br>
        <a class="btn btn-lg btn-success btn-block" onclick="fromSubmit()"  > 找回密码</a><br>
          <div  class="alert alert-success" role="alert"><span class="glyphicon glyphicon-envelope"></span>点击找回密码后，系统将会向您账号绑定的邮箱发送一封带有密令的邮件，
              点击验证后方可重新设置密码，密令48小时内有效，请尽快验证！！！</div>
      </form>
    </div>

    <script src="../jquery/jquery-2.1.1.min.js"></script>
    <script src="../bootstrap/js/bootstrap.min.js"></script>
    <script src="../jquery/layer/layer.js"></script>
    <script type="text/javascript">
        function fromSubmit(){
            var loginacct = $("#loginacct").val();
            if(loginacct==""){
                layer.msg("账号不能为空！",{time:1000,icon:5,shift:6},function () {
                    loginacct.focus();
                })
                return;
            }
            $.ajax({
                url:"/getBackSendMail.do",
                type:"POST",
                dataType:"json",
                data:{
                    "loginacct":loginacct
                },
                beforeSend: function () {
                    loadingIndex = layer.msg('处理中',{icon:16});
                },
                success:function (result) {
                    layer.close(loadingIndex);
                    if(result.success){
                        layer.msg("邮件发送成功，请尽快去您的邮箱里进行验证",{time:4000,icon:6,shift:6});
                    }else{
                        layer.msg("账号不存在，请重新输入",{time:2000,icon:5,shift:6});
                    }
                },
                error:function () {
                    layer.msg("账号名不存在，请重新输入",{time:2000,icon:5,shift:6});
                }
            });
        }



    </script>
  </body>
</html>